package com.my.controller;


import com.my.bean.Student;
import com.my.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2018-08-17
 */
@Controller
@RequestMapping("/student")
public class StudentController {
    @Autowired
    StudentService studentService;
    @RequestMapping("/login")
    @ResponseBody
    public  String login(){
        Student student=new Student();
        student.setName("1");
        student.setAddress("1");
        studentService.insert(student);
        System.err.print(student.getId());
        return "你好";
    }

    @RequestMapping("/index")
    public  String index(){
      System.err.print("来了");
        return "index";
    }




}

